-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transfer tea flavors to datapack resources #39
Draft
Hugman76
wants to merge
11
commits into
main
Choose a base branch
from
tea-data
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Dhranios has made the interesting comment on the Discord server to change the type of the |
Instead of adding a whole registry, maybe we could also move everything to recipe serializing. We would put tea effects only in the NBT data of tea bags/bottles. |
Hugman76
changed the title
Transfer tea flavors part to datapack resources
Transfer tea flavors to datapack resources
Apr 8, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Presentation
This PR aims at making the tea flavors part of data pack resources, instead of hardcoding them by:
culinaire:grant_effect
,culinaire:clear_effect
andculinaire:consume_item
, which each their own codec parametersSyntax
Let's take the file of the sour tea flavor as an example for what the PR is capable of right now:
Location:
culinaire/tea_flavors/sour.json
Identifier:
culinaire:sour
File content:
Objectives
Firstly, I wish to move ingredients and brew times over to proper recipes files, and make input/output customizable too, in case another mod wants to create a new tea-friendly item. Let's also add more parameters for maximum potency amount, paper/string ingredients
Currently, this PR will absolutely break all previous tea bags and tea bottles. I will later add a fix that will re-write NBT data correctly.
This PR also has a bug where if a bottle exists with a flavor, and that flavor gets later deleted, the game will get very laggy, spam the console and probably break the entire tea system. We will disscuss whether or not we directly attach tea effects to the item stack's NBT, or if we make those outdated tea items' NBT data vanish altogether, making the items unusable. I think the first solution is to be preferred.
Right now, I am not sure if tea flavors are correctly synced from server to client. I'll need to test this out and maybe ask a few friends. I have tried doing dynamic registering, but this was a totaly messy experience that I wish I did not do at all. Therefore, it is currently just collected as part of a generic id -> tea flavor set in the singular instance of
TeaFlavorManager
.It is also worth noting that the
ingredients
key does not allow for item arrays yet, asRegistryCodecs.entryList()
just likes to spit at my face and tells me that either the field needs to be a JSON array, or that the item registry is not accessible when it actually IS a JSON array. This is what theminecraft:glow_lichen
feature configuration uses (feature.glow_lichen.can_be_placed_on
), as an example. Maybe the reload listener gets fired too early? I don't know.